package com.startup.yellocar.service.impl;
import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.startup.yellocar.dto.UserTravelDTO;
import com.startup.yellocar.dao.UserTravelDAO;

import com.startup.yellocar.service.UserTravelService;

@Service
@Transactional
public class UserTravelServiceImpl implements UserTravelService {

	@Autowired
	protected UserTravelDAO userTravelDAO;

	@Transactional
	public void insert(UserTravelDTO userTravelDTO){
		userTravelDAO.insert(userTravelDTO);
	}

	@Transactional
	public void update(UserTravelDTO userTravelDTO){
		userTravelDAO.update(userTravelDTO);
	}

	@Transactional
	public UserTravelDTO get(int id) {
		return userTravelDAO.get(id);
	}

	@Transactional
	public List<UserTravelDTO> getAll() {
		return userTravelDAO.getAll();
	}

	@Transactional
	public void delete(UserTravelDTO userTravelDTO){
		userTravelDAO.delete(userTravelDTO);
	}

}
